import fetch from 'utils/fetch';

export function loginByEmail(email, password) {

    let params =new URLSearchParams();
    params.append("username",email);
    params.append("password",password);

  //alert('2:api/login.js');
  return fetch({
    url: '/login/getUserInfo',
    method: 'post',
    params
  });
}

export function logout() {
  return fetch({
    url: '/login/logout',
    method: 'post'
  });
}

export function getInfo(token) {
    let params =new URLSearchParams();
    params.append("username",token);
  return fetch({
    //url: '/user/info',
      url: '/login/getUserInfo',
    method: 'get',
    //params: { token }
      params: params
  });
}

